<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="/common/upLoadFile" method="post" enctype="multipart/form-data">
    <input type="file" name="file">
    <input type="submit" value="提交">
</form>

<input id="file" type="file" name="file">
<input id="sbt" type="submit" value="提交">
</body>
<script type="text/javascript" src="../assets/js/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../assets/js/common.js"></script>
<!--<script type="text/javascript" src="../assets/js/main.js"></script>-->
<script>
    $(function () {
        var param = {
            username: "用户账号名",
            password: "用户密码 密文"
        };
        console.log(inout.getData(ajax.post("/system/query", param)));

        $("#sbt").click(function () {
            var formData = new FormData();
            if ($("#file")[0].files[0] == null) {
                alert("无文件");
                return;
            }
            formData.append("file", $("#file")[0].files[0]);
            ajax.file("/common/upLoadFile", formData);
        });
    });
</script>
</html>